<template>
  <Modal :mask-closable="false"
      v-model="toggle"
      :title="$t('跳过投标')"
      class="modal-content-layout"
  >
    <div>
      <p>{{$t('跳过投标描述')}}</p>
      <Form ref="form" :model="form" :rules="rules" label-position="top">
        <FormItem :label="$t('备注')" prop="remark">
          <Input maxlength="200" v-model="form.remark" type="textarea" :rows="5"/>
        </FormItem>
      </Form>
    </div>

    <div slot="footer">
      <Button type="default" @click="cancel">{{$t('取消')}}</Button>
      <Button type="primary" @click="submit">{{$t('确认')}}</Button>
    </div>
  </Modal>
</template>


<script>

export default {
  name:"jumpBindding",
  props:['id'],
  data() {
    return {
      toggle: false,
      form: {
        remark: ""
      },
      rules: {
        remark: [{required: true, type: "string", message: this.$t('请输入'), trigger: 'blur'}],
      }
    }
  },
  methods: {
    show() {
      this.form.remark = '';
      this.$refs.form.resetFields()
      this.toggle = true
    },
    cancel() {
      this.$refs.form.resetFields()
      this.toggle = false
      this.form.remark = '';
    },
    async submit() {
      const valid = await this.$refs.form.validate()
      if (valid) {
        this.axios({
          method: 'post',
          url: '/dms/capex/submit',
          data: {
            jumpFlag: 1,
            progressCode: "Bidding",
            id: this.id,
            remark:this.form.remark
          }
        }).then(res => {
          if (res.code === 200) {
            this.cancel()
            this.$Message.success(res.msg)
            this.$router.go(-1)
          } else {
            this.$Message.warning(({content: res.msg, duration: 6, closable: true}));
          }
        })
      }
    }
  }
}
</script>
<style>

</style>
